#include <sys/stat.h>
#include <fcntl.h>
#include <semaphore.h>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <unistd.h>

int main(){
    sem_t* semfd=sem_open("/ymbxsem",O_CREAT,0666,1);
    sem_t* semfd2=sem_open("/ymbxsem2",O_CREAT,0666,0);
    if(semfd==SEM_FAILED){
        perror("sem_open error");
        exit(1);
    }
    while(1){
        sem_wait(semfd2);
        printf("send message\n");
        sleep(5);
        sem_post(semfd);
        break;
    }
    
    return 0;
}